package com.ling.pl.autoproject.definition.model;

import com.ling.pl.autoproject.definition.programme.model.Programme;
import com.ling.pl.core.commons.annotation.ModelProperty;
import com.ling.pl.core.hibernate.identifier.Ling2UUIDGenerator;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;

import javax.persistence.*;

/**
 * Created by builder
 */
@Entity
@Table(name = ProgrammeEntity.TABLE)
public class ProgrammeEntity extends Programme {
    public static final String TABLE = "T_PROGRAMME";
    public static final String SEQ = TABLE;

    @Id
    @ModelProperty(comment = "ID")
    @GenericGenerator(name = SEQ + "_GENERATOR", strategy = Ling2UUIDGenerator.STRATEGY_NAME, parameters = {@Parameter(name = "pkColumnValue", value = SEQ)})
    @GeneratedValue(strategy = GenerationType.TABLE, generator = SEQ + "_GENERATOR")
    @Column(name = "ID", unique = true, nullable = false, length = 36)
    String id;

    @Override
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }
}
